package com.qef.com.mmovie.presenter;

import com.qef.com.mmovie.entity.LaughImgEntity;
import com.qef.com.mmovie.entity.VVIdeoDetailsEntity;
import com.qef.com.mmovie.mvp.interactor.LaughImgInteractor;
import com.qef.com.mmovie.net.IGetDataDelegate;
import com.qef.com.mmovie.presenter.contract.LauthImgContract;
import com.qef.com.mmovie.presenter.contract.LauthImgDetailsContract;

import javax.inject.Inject;

import io.reactivex.disposables.Disposable;

/**
 * Created by guangjiego on 2017/3/31.
 */

public class LaughImgDetailsPresenter extends RxPresenter<LauthImgDetailsContract.View> implements LauthImgDetailsContract.Presenter {
    @Inject
    LaughImgInteractor interactor;

    @Inject
    public LaughImgDetailsPresenter() {
    }

    @Override
    public void getLaughList(int postId) {
        interactor.test(postId);
        Disposable disposable = interactor.loadLaughImgDetailsList(postId, new IGetDataDelegate<VVIdeoDetailsEntity>() {
            @Override
            public void getDataSuccess(VVIdeoDetailsEntity laughImgEntity) {
                mView.showContent(laughImgEntity);
            }

            @Override
            public void getDataError(Throwable throwable) {
                mView.error(throwable);
            }
        });
        addSubscrebe(disposable);
    }
}
